﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement"

ColumnLayout{
    RowLayout{
        spacing: 20

        XYModulePos{
            moduleName: "PickArmXY"
            posName: "Picker1GetcalibGrassPos"
        }

        SAxisModulePos{
            moduleName: "PickerZ1"
            posName: "PickCalibraGrassPos"
        }

        XYModulePos{
            moduleName: "PickArmXY"
            posName: "Picker1DownlookPrPos"
        }
    }

    ColumnLayout{
        spacing: 20

        RowLayout{
            ConfigRow{
                configName: "picker1ToCameraOffsetX"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }

            ConfigRow{
                configName: "picker1ToCameraOffsetY"
                configModel: paConfig
                Component.onCompleted: {
                    autoInit()
                }
            }
            Button{
                text: qsTr("PickGlassWithOffset")
                onClicked: {
                    tem.runSingleCmd(pickArm, "pickGlassWithOffset", [true])
                }
            }
            Button{
                text: qsTr("PlaceGlass")
                onClicked:
                {
                    tem.runSingleCmd(pickArm, "placeCalibGlass", [true])
                }
            }
        }
    }

    RowLayout{
        spacing: 20
        Button{
            text: qsTr("CalibratePickerToDownLookCameraOffset")
            onClicked: {
                tem.runSingleCmd(pickArm, "calibratePickerToDownLookCameraOffset", [true])
            }
        }
    }
}

